import 'dart:math';
import 'package:dio/dio.dart';
import 'package:wallpaper/http/dio_instance.dart';

Future<Response> mohuImgsApi({required String id}) =>
    DioInstance.instance().get(path: 'https://img.moehu.org/pic.php', param: {
      'id': id,
      'return': 'json',
      'size': 'mw690',
      'num': '4',
      'radom': Random().nextDouble(),
    });

Future<Response> getPixiv({String tag = '', var r18 = 0}) =>
    DioInstance.instance()
        .post(path: 'https://setu.yuban10703.xyz/setu', data: {
      'num': 30,
      'r18': r18,
      'replace_url': "https://i.pixiv.re",
      'tags': [tag],
      'radom': Random().nextDouble(),
    });

Future<Response> getPixiv2({String tag = '', var r18 = 0}) =>
    DioInstance.instance().post(path: 'https://api.lolicon.app/setu/v2', data: {
      'num': 20,
      'r18': r18,
      'tag': [tag],
      'size': ['original', 'small'],
      'radom': Random().nextDouble(),
    });

Future<Response> randomVideo() => DioInstance.instance()
    .get(path: 'https://api.kxzjoker.cn/API/Beautyvideo.php?type=json');
